﻿using UnityEngine;

using System.Collections;

using System;

public class MedEnemyProjectile : MonoBehaviour {

    

    public GameObject enemybullet;

    private double radius=0.1;

    private double pointx,pointy;

    private double angle,angle1,angle2;

    private Vector3 projposition;

    private float speed=10;

    private Transform myTransform;

    private float amtToMove;

    private bool shoot=false;

    // Use this for initialization

    void Start () {

        angle=0;

            myTransform=transform;

                StartCoroutine("drawcircle");    

        

        

    

        

    }

    

    // Update is called once per frame

    void Update () {

    }


    private double DegreeToRadian(double a)

    {

        double answer;

        answer = Math.PI * (a/180.0);

        return answer;

    }

    IEnumerator drawcircle()

    {

        for(int i=0;i<360;i+=1)

        {

            angle1=Math.Cos(DegreeToRadian(angle+i));

            angle2=Math.Sin(DegreeToRadian(angle+i));

            pointx=radius*angle1;

            pointy=radius*angle2;

            projposition=new Vector3((float)pointx,(float)pointy,0);

            Instantiate(enemybullet,projposition,Quaternion.identity);

        }

        yield return new WaitForSeconds(5f);
 

    }

}